package com.yanzhu.service.mapper;

import com.yanzhu.service.model.Material;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author: 方炎柱
 * @Description:
 * @Date: Created in 19:48 2018/1/31
 * @Modified:
 */
@Mapper
public interface MaterialMapper {
    @Insert("insert into material(tid, duration, is_loop, picture_path, start_time, width, height, frame_sum, l_percent, u_percent, z_index, ani_type)" +
            " values(#{tid}, #{duration}, #{is_loop}, #{picture_path}, #{start_time}, #{width}, #{height}, #{frame_sum}, #{l_percent}, #{u_percent}, #{z_index}, #{ani_type})")
    int insert(Material material);

    @Select("select * from material where id = #{id}")
    Material queryMaterialById(@Param("id") long id);

    @Select("select * from material where tid = #{tid}")
    List<Material> queryMaterialListByTid(@Param("tid") long tid);

    @Delete("delete from material where tid = #{tid}")
    int deletematerialByTid(@Param("tid") long tid);
}
